package com.icss.lesson3;

import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;
import org.junit.Test;

import java.io.*;
import java.util.Date;

public class TestMain3 {

    public static void main(String[] args) throws Exception{

            // finally自动关闭的变量，
            InputStream is = new FileInputStream("D:/a.txt");
            // 实例化一个 字节输入流
            byte[] buffer = new byte[10]; // {0,0.0,0,0,0,0,0,0,0,}

            // 输入流读入到 buffer, 返回值是读了几个字节
            int len = is.read(buffer);
            for (int i = 0; i < buffer.length; i++) {
                System.out.println(buffer[i]);
            }
            System.out.println(new String(buffer,0, len, "utf-8"));

            // 流是要关闭的
            is.close();

    }
}
